<!DOCTYPE html>

<html>
    <head>
            <meta charset="utf-8">
            <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
            <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
            <link rel="stylesheet" type="text/css" href="../../css/aui.css">
            <link rel="stylesheet" type="text/css" href="../../css/aui-slide.css">
            <link rel="stylesheet" type="text/css" href="../../css/api.css">
            <link rel="stylesheet" href="../../css/common.css">
            <link rel="stylesheet" type="text/css" href="../../font-icon/demo.css">
            <link rel="stylesheet" type="text/css" href="../../font-icon/iconfont.css">
            <script type="text/javascript" src="../../script/api.js"></script>
            <script type="text/javascript" src="../../script/APICloud-rest.js"></script>
            <script type="text/javascript" src="../../script/APICloud-rest-SHA1.js"></script>
            <script type="text/javascript" src="../../script/SHA1.js"></script>
            <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
            <style>
                .cont_neirong{
                    margin-left: 0.4rem;
                }
                .sta3_1{
                    display: flex; flex-direction: row;flex-wrap: wrap;justify-content: start;float: left; margin-left: -1%;margin-bottom: 1%;
                    border: solid #f5f5f5 0.1rem; margin-left: -0.2rem;width:100%;background-color: #f5f5f5;position: relative;z-index: 0;
                }
                .sta3{
                
                    display: flex; flex-direction: row;flex-wrap: wrap;justify-content: start;float: left; margin-left: -1%;margin-bottom: 1%;
                    
                }
                .zhuanfa_name{
                    font-size: 0.8rem;color:#2a5683;
                }
                .zhuanfa_coment{
                    font-size: 0.8rem;
                    line-height: 1.2rem;
                    margin-left: 1%;
                }
                .zhuanfa_img div img{
                    width: 100%;height:auto;
                
                }
                .zhuanfa_img div{
                    width: 30%;height:30%;
                    margin:1.5%;
                }
                .zhuanfa_img{
                    display: flex;flex-direction: row;flex-wrap: wrap;
                }
                .zhuanfa{
                    display: flex;flex-direction: row;flex-wrap: nowrap;
                   
                }
                .zhuanfa_share{
                    width:100% ;
                    height:3.4rem;
                   position:absolute;
                 bottom:2rem;
                 z-index: 999;
                    /* margin-left: ;
                    margin-top: ; */
                    border-radius: 0.3rem;
                    background-image: url('../../image/share_bottom.png');
                    background-repeat: no-repeat;
                    background-size: 100% 100%;
                    display: none;margin-left: -0.4rem;
                    
                }
                .li_img{
                    width: 0.8rem;height: 0.8rem;
                    
                }
                .chang_1{
                    width: 94%;height:410%;background-color: black;position: absolute;z-index:33;opacity: 0.4;margin-left: 3%;
                }
                
                </style></head>
                
                
                <body >
                  <div style="background-color: #f8931f;">
                    <div id="youquan_tab">
                    <header id="header" class="aui-bar aui-bar-nav">
                        <span class="aui-iconfont aui-icon-left" style="float: left; margin-left: 0.6rem;   margin-top: 0.6rem;" onclick="api.closeWin()"></span>
                       
                     
                        <div class="aui-title">我的动态</div>
                        
                    </header>
                
                
                
                    <div class="aui-tab" id="tab" style="margin-top: -0.2rem;">
                        <!-- <div class="aui-tab-item aui-active" id="select" onclick="Select()">精选</div>
                         <div class="aui-tab-item" id="focus" onclick="Focus()">关注</div>
                         <div class="aui-tab-item" id="mine" onclick="Mine()">我的</div> -->
                        <!-- <div class="aui-tab-item aui-active" id="select" onclick="switchBtn(this,0)" tapmode="">热门</div>
                        <div class="aui-tab-item" id="focus" onclick="switchBtn(this,1)" tapmode="">关注</div>
                        <div class="aui-tab-item" id="mine" onclick="switchBtn(this,2)" tapmode="">附近</div> -->
                        <!-- <div class="aui-tab-item" onclick="openPublish()">发表</div> -->
                        </div>
                    </div>
                
                
                    
                            
                            <div class="aui-content-padded aui-margin-t-10" id="content" style="position: relative;top: 3rem;z-index: 0;width: 94%;left:3%;background-color: #fff;">
                                
                           
                            </div>
                           
                         
                           
                
                            <!-- <div class="aui-content aui-pull-left aui-margin-t-5">
                            <div class="aui-card-list-header aui-text-white aui-font-size-18 aui-bg-default">
                            </div>
                            </div> -->
                
                            <div class="aui-card-list-footer aui-text-center" id="refresh" style="margin-top: 5rem;" onclick="jiazai_more()">
                            <span>点击加载更多...</span>
                        
                             </div>
                        </div>
                <!-- <script type="text/javascript" src="../../script/youquan.js"></script> -->
                <!-- <script type="text/javascript" src="../../script/common.js"></script> -->
                
                <script type="text/javascript"> 
                apiready = function() {
                var b=0;
                $api.setStorage('limit','0,10');


$('body').on('click','#refresh',function(){
                                b=b+10;
                                String(b);
                               var lim1=b+',10';
                             
                               $api.setStorage('limit',lim1);
                               star1();

});


star1();
                  function star1(){
                    var limit = $api.getStorage('limit');
                      var token = $api.getStorage('token');
                      
 	var token = {
                token: token,
                categry:'mine',
                 limit:limit
            };api.ajax({
            url: 'http://www.mk517.com/webApi/youquans.php',
            method: 'post',
            "headers": {
                "Content-Type": "application/json"
            },
            dataType: "json",
            data: {
                body: token
            }
        }, function(ret, err) {
            // alert(JSON.stringify(ret));
            if (ret) {
                // alert(JSON.stringify(ret));
              
                               // alert(ret[0]['head_img']);
                           
                             
                                for(var i=0;i<=ret.length;i++){ 
                                   
                                  
                                     var  sta1= '<div class="aui-card-list aui-content"><div class="aui-card-list-header aui-card-list-user ">'+
                                   ' <div class="aui-card-list-user-avatar"><img id="post_user_avater" src="'+ret[i]['head_img']+'" class="aui-img-round"></div>'+
                                       '<div class="aui-card-list-user-name">'+
                                       ' <div id="post_username">'+ret[i]['name']+'<i id="hotIcon0" class="icon iconfont"></i></div>'+
                                   ' <div style="position: absolute;width:4rem; margin-top:1rem;height:0.8rem;margin-left: 0rem;font-family: SimHei;color: #787878;font-size: 0.75rem;line-height:0.8rem;">'+ret[i]['time']+'</div>'+
                                   '  <div class=" aui-btn-warning1 "style="border:none;" ></div><input value="'+ret[i]['uid']+'" type="hidden"></div>'+
                                   ' <div class="aui-down"> '+
                                       '  <i class="aui-iconfont aui-icon-down"></i>'+
                                   ' </div> </div>'+
                                   ' <div class="cont_neirong">'+
                                       ' <p id="post_goods_content" onclick="openPostInfo(1,2)">'+ret[i]['content']+'</p>';
                                    
                                 
                                   
                             
                                       var sta2="";
                                       if(ret[i]['img'].length!=0 && ret[i]['img'].length!=null){
                                           for(var j=0;j< ret[i]['img'].length;j++){
                                               console.log(ret[i]['img'][j]);
                                           sta2+=
                                           ' <div onclick="openPostInfo(1,2)" style="width:31%;height:31%; margin: 1%">'+
                                           '<img src="https://'+ret[i]['img'][j]+'" id="picture1" style="width:100%;height:auto;max-width:100%;max-height:100%;overflow:hidden;"></div>'; 
                                           }        
                                       }
                                       
                                   sta2_1='<div class="zhuanfa_share" id="sss">'+
                                   '<li style="height:43%;line-height:250%;">'+
                                   '<span  class="aui-iconfont aui-icon-share" style="margin-left:10%;color:#999999;font-weight: bold;"></span>'+
                                   '<span style="font-size:0.7rem;margin-left:1rem; " class="share_share">分享</span></li >'+
                                   '<li style="margin-left:5%; width:90%;height:0.05rem;background-color:#d2d2d2;"></li>'+
                                   '<li onclick="open_zhuanfa()" ><img class="li_img" src="../../image/zf.png" style="margin-left:10%;margin-top:0.2rem"><span style="float:left;font-size:0.7rem;margin-left:3.5rem;margin-top:-0.8rem;;">转发</span>'+
                                   '</li></div>';
                                   var sta0='<div id="dashang_div"style="border: solid 0.05rem #000;position: absolute;top:-8rem;right:4rem;z-index: 999;width:10rem;height:5.95rem;background-color:#f8931f;border-radius: 0.5rem;font-size: 0.8rem;display:none;">'+
                                      ' 请输入打赏金额:'+
                                      ' <input style="border: solid 0.05rem #000;margin-top: 0.2rem;margin-left: 1rem;width:8rem;height: 2rem;border-radius: 0.5rem;background-color: #fff"type="number" maxlength="6" id="dashang_mon" >'+
                                       '<button style="margin-top: 0.5rem;border-radius: 0.5rem;background-color: #fff;width:3.6rem;height:1.6rem;margin-left: 3.4rem;" class="post_money010">确定</button>'+
                                       '<input value="'+ret[i]['id']+'" type="hidden">'+
                               '</div>';
                                     
                                     
                                                                        if(ret[i]['is_zan']==1){
                                                                                       var dianzan_123 = '<span  class="aui-iconfont aui-icon-laud " style="color:#f84d1f;">'+ret[i]['zan']+'</span>'+
                                                                                       '<input type="hidden" value="'+ret[i]['is_zan']+'">';
                                                                                       
                                                                                     
               
                                                                               }else if(ret[i]['is_zan']==0){
                                                                                       var dianzan_123 = '<span  class="aui-iconfont aui-icon-laud " >'+ret[i]['zan']+'</span>'+
                                                                                       '<input type="hidden" value="'+ret[i]['is_zan']+'">';
                                                                               }
               
                                       sta3=
                                           ' <div class="aui-card-list-footer aui-border-t"><div id="post_star_count">'+
                                           ' <li class="zhuanfa">'+
                                           ' <img src="../../image/zf.png" style="width:0.8rem;height: 0.8rem;" onclick="sharePost(0);">'+ret[i]['forward_count']+' </li>'+
                                           '<input value="'+ret[i]['id']+'" type="hidden">'+
                                       ' </div>'+
                                       ' <div id="post_laud_count">'+
                                           '  <li id="laud0" class="dianzan456" >'+ dianzan_123+'</li>'+
                                           '<input value="'+ret[i]['id']+'" type="hidden">'+
                                           '</div>'+
                                       '  <div id="post_note_count">'+
                                           '<li class="aui-iconfont aui-icon-comment comment_dongtai_more" id="note" onclick="postComment(1,2)">'+ret[i]['comment']+'</li><input value="'+ret[i]['id']+'" type="hidden"></div><div id="post_star_count">'+//进入动态
                                           // cout_is_zhuanfa+
                                           ' <li style="display: flex;flex-direction: row;flex-wrap: nowrap" class="dashang456"><img style="width:1rem;height: 1rem;" src="../../image/reward.png" >'+ret[i]['reward']+'</li>' +
                                           sta0+
                                           '</div></div></div>';
                                           
                                           
                                           if(ret[i]['forward']==''||ret[i]['forward']==null){
                                               $api.byId('content').innerHTML+=sta1+'  <div class="sta3" id="sss"> '+sta2+'</div><input value="'+ret[i]['id']+'" type="hidden">'+sta2_1+sta3;
                                                 
                                       
                                           }else{
                                               
                                               sta5=' <div class="sta3_1">'+//进入转发
                                                       '<input value="'+ret[i]['id']+'" type="hidden">'+
                                                       '<input value="'+ret[i]['forward']+'" type="hidden">'+
                                                       '<div class="zhuanfa_name">'+ret[i]['forward_name']+'&nbsp;:</div>'+
                                                       '<div class="zhuanfa_coment">'+ret[i]['forward_content']+'</div>'+
                                                       '<div class="zhuanfa_img"> ';
                                           var sta6='';
                                               for(var k=0;k<ret[i]['forward_img'].length;k++){
                                                   sta6 += '<div><img src="'+ret[i]['forward_img'][k]+'"></div>';
                                                   
                                               }
                                           
                                               sta7='</div></div>';
                                               $api.byId('content').innerHTML+=sta1+sta5+sta6+sta7+'<input value="'+ret[i]['id']+'" type="hidden">'+sta2_1+sta3;
               
                                                
                                               
                                           }
                                           
                                       }  
                               
                                

                
             }else {
                alert(JSON.stringify(err));
            }
        });
                  }
        
       
                  $('body').on('click','.dianzan456',function(){
                                 var som_dianzan=$(this).children('input').last().val();
                                
                                 var new_id = $(this).next('input').first().val();
                             
                                   if(som_dianzan==0){//没有
                                
                                          var  do_zan='zan';
                                   }else if(som_dianzan==1){//赞了
                                        var  do_zan='zan_del';
                
                                         
                                   } 
                                  var token = $api.getStorage('token');
                                              
                  
                  
                                                         var token = {
                                                                 token: token,
                                                                 to:new_id,//dangqian
                                                                 do:do_zan 
                                                                
                                                         };
                                                         api.ajax({
                                                         url: 'http://www.mk517.com/webApi/youquan_do.php',
                                                         method: 'post',
                                                         "headers": {
                                                                 "Content-Type": "application/json"
                                                         },
                                                         dataType: "json",
                                                         data: {
                                                                 body: token
                                                         }
                                                         }, function(ret, err) {
                                                         // alert(JSON.stringify(ret));
                                                         if (ret) {
                                                                
                                                            if(ret.sta==3){
                                                                    alert('操作成功!');
                                                                    window.location.reload();
                                                                   
                                                            }else if(ret.sta==2){
                                                                  alert('操作失败!');
                                                            }
                                                                 
                                                         }else {
                                                                 alert(JSON.stringify(err));
                                                         }
                                                         });
                           });

//打赏

$('body').on('click','.dashang456',function(){
                                     alert('不能打赏自己')
                
                                    });

                                    //转发
                                    $('body').on('click','.zhuanfa',function(){
                                   alert('不能转发自己哦')
                                });
//进入转发
$('body').on('click','.sta3_1',function(){
                
                var id_dongtai_xq =  $(this).children('input').first().val();
               
                var id_dongtai_xq_zh =  $(this).children('input').last().val();
                $api.setStorage('id_dongtai_xq',id_dongtai_xq);
                 $api.setStorage('id_dongtai_xq_zh',id_dongtai_xq_zh);
                 api.openWin({
                 name: 'xiangqing_dongtai',
                 url: 'xiangqing_dongtai.html',
                 rect: {
                     x: 0,
                     y: 0,
                     w: 'auto',
                     h: 'auto'
                 },
                 pageParam: {
                     token: $api.getStorage('token')
                 },
                 allowEdit: true
        });
             });
            //评论
            $('body').on('click','.comment_dongtai_more',function(){
                                    var di_now = $(this).next('input').val();
                                    // alert(di_now);
                                    // $api.setStorage('id_now',id_now);
                                    
                                    $api.setStorage('id_dongtai_xq_zh', $(this).next('input').val());
                                    // var id_dongtai_xq =  $(this).children('input').first().val();
                                    // var id_dongtai_xq_zh =  $(this).children('input').last().val();
                                    // $api.setStorage('id_dongtai_xq',id_dongtai_xq);
                                    // $api.setStorage('id_dongtai_xq_zh',id_dongtai_xq_zh);
                                    api.openWin({
                                    name: 'xiangqing_dongtai',
                                    url: 'xiangqing_dongtai.html',
                                    rect: {
                                        x: 0,
                                        y: 0,
                                        w: 'auto',
                                        h: 'auto'
                                    },
                                    pageParam: {
                                        token: $api.getStorage('token')
                                    },
                                    allowEdit: true
                                    });
                                    });
        
    }
                </script>
                
                
                </html>